<template>
	<view>
		<u-navbar :safeAreaInsetTop="true" :placeholder="true" :title="title">
			<template #left>
				<view class="u-nav-slot">
					<view class="back" @click="goBack">
						<u-icon name="arrow-left" size="19"></u-icon>
					</view>
					<view class="home" @click="goHome">
						<u-icon name="home-fill" size="20"></u-icon>
					</view>
				</view>
			</template>
		</u-navbar>
	</view>
</template>

<script setup>
	defineProps(['title'])
	const goBack = () => {
		uni.navigateBack()
	}
	const goHome = () => {
		uni.reLaunch({
			url: '/pages/index/index'
		})
	}
</script>

<style scoped lang="scss">
	.u-nav-slot {
		display: flex;
		justify-content: space-between;
	}

	.back {
		width: 88rpx;
		height: 64rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		border: 2rpx solid #eee;
		border-radius: 50rpx 0 0 50rpx;
	}

	.home {
		width: 88rpx;
		height: 64rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		border: 2rpx solid #eee;
		border-radius: 0 50rpx 50rpx 0;
	}
</style>